package hibernateDemo.DAO;

import java.io.Serializable;
import java.util.List;

import hibernateDemo.entity.Student;
import hibernateDemo.util.HibernateUtil;

public class StudentDAO {
	public void save(Student student) {
		HibernateUtil.save(student);
	}
	public void delete(Student student) {
		HibernateUtil.delete(student);
	}
	public void update(Student student) {
		HibernateUtil.update(student);
	}
	public Student get(String name) {
		return (Student)HibernateUtil.get(name,"Student");
	}
	public Student get(long id) {
		return (Student)HibernateUtil.get(Student.class,id);
	}
	public List getAll() {
		return HibernateUtil.getAll("Student");
	}
}
